<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <div class="dad">
        <div class="son"></div>
    </div>
    
</head>
<body>
    
</body>
<style lang="less">
    .dad{
        width: 400px;
        height: 400px;
        /* position: relative; */
        background-color: pink;
        display: grid;
        /* display: flex;
        justify-content: center;
        align-items: center; */
        
    }
    .son{
        width: 200px;
        height: 200px;
        /* position: absolute; */
        justify-self: center;
        align-self: center;

        background-color: purple;
        /* top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    } */
</style>
</html>